package com.wuseguang.springcloud.dao.jdbc;

import com.wuseguang.springcloud.JdbcTemplate.BaseTemplate;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

@Repository
public class TeachingClassesTemplate extends BaseTemplate {


    public Map<String, String> queryclass(String sql, Object... args) {
        return dao.query(sql, args, rs -> {
            Map<String, String> map = new HashMap<String, String>();
            while (rs.next()) {
                map.put("id", rs.getString("id"));
                map.put("classicon", rs.getString("class_icon"));
                map.put("classname", rs.getString("name"));
                map.put("slogan", rs.getString("slogan"));
                map.put("gradename", rs.getString("gradename"));
            }
            return map;
        });
    }


}
